package com.example.book.dao.impl;

import com.example.book.dao.OrderItemDao;
import com.example.book.pojo.OrderItem;

/**
 * @Description
 * @ClassName OrderItemDaoImpl
 * @Author 山山大魔王
 * @Date 2021/12/3 17:17
 * @Version 1.0
 */
public class OrderItemDaoImpl extends BaseDao implements OrderItemDao {
    @Override
    public int saveOrderItem(OrderItem orderItem) {
        System.out.println("OrderItemDaoImpl程序在["+Thread.currentThread().getName()+"]中");


        String sql = "insert into t_order_item(`name`,`count`,`price`,`total_price`,`order_id`) values(?,?,?,?,?)";

        return update(sql,orderItem.getName(),orderItem.getCount(),orderItem.getPrice(),orderItem.getTotalPrice(),orderItem.getOrderId());
    }
}
